package net.bolue.sysmng.tblbean;

import java.util.Iterator;
import java.util.Map;
import java.util.Set;


/**
 * 报表资源
 * @author Administrator
 *
 */
public class RepRes extends TableBean{

	/**
	 * 子系统
	 */
	private String subSys;
	
	/**
	 * 报表id
	 */
	private Integer repId;
	
	/**
	 * 数据源
	 */
	private String dataSrc;
	
	/**
	 * 允许编辑
	 */
	private Integer isEdit;
	
	/**
	 * 报表描述
	 */
	private String repDesc;
	
	public String getSubSys() {
		return subSys;
	}

	public void setSubSys(String subSys) {
		this.subSys = subSys;
	}

	public Integer getRepId() {
		return repId;
	}

	public void setRepId(Integer repId) {
		this.repId = repId;
	}
	
	public String getDataSrc() {
		return dataSrc;
	}

	public void setDataSrc(String dataSrc) {
		this.dataSrc = dataSrc;
	}

	public Integer getIsEdit() {
		return isEdit;
	}

	public void setIsEdit(Integer isEdit) {
		this.isEdit = isEdit;
	}

	public String getRepDesc() {
		return repDesc;
	}

	public void setRepDesc(String repDesc) {
		this.repDesc = repDesc;
	}

	@Override
	public RepRes mapToEntry(Map<String, Object> map) {
		RepRes report = new RepRes();
		Set<String> keySet = map.keySet();
		Iterator<String> keyIt = keySet.iterator();
		while(keyIt.hasNext()){
			String key = keyIt.next();
			Object o = map.get(key);
			if("SUBSYS".equals(key)){
				report.setSubSys((String)o);
			} else if("REPID".equals(key)){
				report.setRepId((Integer)o);
			} else if("REPDESC".equals(key)){
				report.setRepDesc((String)o);
			} else if("ISEDIT".equals(key)){
				report.setIsEdit((Integer)o);
			} else if("DATASRC".equals(key)){
				report.setDataSrc((String)o);
			}
		}
		return report;
	}
	
	@Override
	public String tableName(){
		return "st_report";
	}

	@Override
	public String keyProps() {
		return "SUBSYS,REPID";
	}
	
}
